package com.powernode.work.controller;

import com.powernode.commons.utils.ResponseData;
import com.powernode.work.bean.ActivityRemarkBean;
import com.powernode.work.service.ActivityRemarkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("activityRemark")
@Api(tags = "活动备注")
public class ActivityRemarkController {
    @Autowired
    private ActivityRemarkService service;


    @GetMapping
    @ApiOperation("根据活动的主键获取备注")
    public ResponseData getActivityRemarkByActivityId(String activityId){
        return service.findByActivityId(activityId);
    }

    @PostMapping
    @ApiOperation("添加备注")
    public ResponseData add(@RequestBody ActivityRemarkBean remark){
        return service.add(remark);
    }

    @PutMapping
    @ApiOperation("修改备注")
    public ResponseData edit(@RequestBody ActivityRemarkBean remark){
        return service.modify(remark);
    }

    @DeleteMapping
    @ApiOperation("根据主键删除")
    public ResponseData delete(String remarkId){
        return service.remove(remarkId);
    }

}
